import { axios } from '@/utils/request'

/**
 * 分页查询
 */
export function fetchList (params) {
  return axios({
    url: '/models/page',
    method: 'get',
    params: params
  })
}

/**
 * 发布
 */
export function publish (modelId) {
  return axios({
    url: '/models/publish/' + modelId,
    method: 'post'
  })
}

/**
 * 删除流程
 */
export function remove (modelId) {
  return axios({
    url: '/models/remove/' + modelId,
    method: 'delete'
  })
}

export function getFlowChart (id) {
  return axios({
    url: '/models/getFlowChart/' + id,
    method: 'get',
    responseType: 'arraybuffer'
  })
}
